import java.util.Scanner;
import java.util.Stack;

public class Main {


    public static void main(String[] args) {
        Mystack mystack = new Mystack();
        mystack.push(1);
        mystack.push(2);
        mystack.push(3);
        System.out.println(mystack.top());

        System.out.println(mystack.pop());
        System.out.println(mystack.top());

        System.out.println(mystack.pop());
        System.out.println(mystack.top());

    }
    public static void main4(String[] args) {
        MyQueue2 queue2 = new MyQueue2(8);
        queue2.offer(2);
        queue2.offer(5);
        queue2.offer(6);
        queue2.offer(7);
        queue2.offer(8);
        System.out.println(queue2.pool());
        System.out.println(queue2.pool());
        System.out.println(queue2.pool());
        System.out.println(queue2.peekRear());

    }
    public static void main3(String[] args) {
        //双链表的队列
        MyQueue3 queue = new MyQueue3();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.display();
        System.out.println(queue.pool());
        System.out.println(queue.pool());
        System.out.println(queue.pool());
        System.out.println(queue.pool());
        queue.offer(666);
        queue.offer(999);
        System.out.println(queue.isEmpty());
        System.out.println(queue.pool());
        System.out.println(queue.peek());

    }
    public static void main2(String[] args) {
        //最小栈
        MinStack minStack = new MinStack();
        minStack.push(-2);
        minStack.push(0);
        minStack.push(-3);
        System.out.println(minStack.getMin());
        minStack.pop();
        System.out.println(minStack.top());
        System.out.println(minStack.getMin());

    }
    public static void main1(String[] args) {
        MyQueue1 queue = new MyQueue1();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);
        System.out.println(queue.size());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());


        queue.display();
    }
}
